<style lang="less">
	 .news{
      width: 100%;
      margin-top: 2rem
    }
    .news-title{
      display:flex;
      justify-content: space-between;
      font-size: 1rem;
    }
    .news-content{
      margin-top: 1rem;
      background: #e9e9e9;
      height: 17rem;
      padding: 1rem;
    }
    .news-content p{
      line-height: 2em;
      font-size: 1.07px;  
    }
    .news-content a{
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
</style>
<template>
	 <div class="news">
      <div class="news-title">
        <h2>楼市资讯</h2>
        <router-link to="news"><span @click="scrollTop">了解更多>></span></router-link>
      </div>
      <div class="news-content">
        <p v-for="news in newses">
          <router-link :key="news.id" :to="{name:'newsDetail', params: {id: news.id}}">
          {{news.title | newsTitleSubstring(0,25)}}
          </router-link>
        </p>
      </div>
    </div>
</template>
<script>

	import api from '@/service/api'
	export default{
		data(){
			return {
				newses:[]
			}
		},
		created () {
      		api.homePageNewsTop8().then((res) => {
       		this.newses = res.data.top8
      	})
    }
	}
</script>